package com.yanqu.road.server.cmd.activity.twins;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.TwinsProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.twins.CrossTwinsMgr;
import com.yanqu.road.server.manager.activity.twins.activity.CrossTwinsActivity;
import com.yanqu.road.server.protocol.CrossProtocol;

@Cmd(code = CrossProtocol.C2_CROSS_TWINS_LUCK_DRAW_RECORD, desc = "")
public class CrossTwinsLuckDrawRecordCmd extends CrossUnionCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        TwinsProto.TwinsLuckDrawRecordReqMsg reqMsg = TwinsProto.TwinsLuckDrawRecordReqMsg.parseFrom(packet.getBytes());
        CrossTwinsActivity activity = CrossTwinsMgr.getActivity(reqMsg.getActivityId(),groupId);
        if(activity != null){
            activity.luckDrawRecord(serverId,packet.getPlayerId(),reqMsg);
        }
    }

    @Override
    public void sendData() {

    }
}
